package com.ssm.service;

import com.ssm.entity.Department;
import com.ssm.entity.Employee;
import com.ssm.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserServiceimpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public int add(Employee employee) {
        return userMapper.add(employee);
    }

    @Override
    public int update(Employee employee) {
        return userMapper.update(employee);
    }

    @Override
    public int del(Long id) {
        return userMapper.del(id);
    }

    @Override
    public List<Employee> getall(String realname) {
        return userMapper.getall(realname);
    }

    @Override
    public Employee get(Long id) {
        return userMapper.get(id);
    }

    @Override
    public List<Department> list() {
        return userMapper.list();
    }
}
